<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Linux云主机（VPS）HOME分区扩容操作流程（来自：西部数码） - Feng&#39;s Blog - 大灰鼠的博客</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Feng" /><meta name="description" content="以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。**特别提醒：删除分区后" /><meta name="keywords" content="feng, 折腾人生, 电脑维修, 手机玩转, 技术心得, 拆机, 网站建设, 快乐悠悠, uu, 悠悠, 博客" />






<meta name="generator" content="Hugo 0.76.5 with theme even" />


<link rel="canonical" href="https://uu126.gitee.io/2014/67.html" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">



<link href="/sass/main.min.c7bc1becf36bcf6a9ebd25d2947e43a2eb745ddb0c9a32b43126fd7fa460c351.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="Linux云主机（VPS）HOME分区扩容操作流程（来自：西部数码）" />
<meta property="og:description" content="以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。**特别提醒：删除分区后" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://uu126.gitee.io/2014/67.html" />
<meta property="article:published_time" content="2014-02-23T21:22:01+00:00" />
<meta property="article:modified_time" content="2014-02-23T21:22:01+00:00" />
<meta itemprop="name" content="Linux云主机（VPS）HOME分区扩容操作流程（来自：西部数码）">
<meta itemprop="description" content="以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。**特别提醒：删除分区后">
<meta itemprop="datePublished" content="2014-02-23T21:22:01+00:00" />
<meta itemprop="dateModified" content="2014-02-23T21:22:01+00:00" />
<meta itemprop="wordCount" content="1502">



<meta itemprop="keywords" content="" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Linux云主机（VPS）HOME分区扩容操作流程（来自：西部数码）"/>
<meta name="twitter:description" content="以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。**特别提醒：删除分区后"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">Feng&#39;s Blog</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">Home</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">Archives</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">Tags</li>
      </a><a href="/links/">
        <li class="mobile-menu-item">Links</li>
      </a><a href="/ly/">
        <li class="mobile-menu-item">Ly</li>
      </a><a href="/about/">
        <li class="mobile-menu-item">About</li>
      </a>
  </ul>
</nav>
  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">Feng&#39;s Blog</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">Home</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">Archives</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">Tags</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/links/">Links</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/ly/">Ly</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/about/">About</a>
      </li>
  </ul>
</nav>
    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">Linux云主机（VPS）HOME分区扩容操作流程（来自：西部数码）</h1>

      <div class="post-meta">
        <span class="post-time"> 2014-02-23 </span>
        <div class="post-category">
            <a href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/"> 网站建设 </a>
            </div>
          <span class="more-meta"> 约 1502 字 </span>
          <span class="more-meta"> 预计阅读 3 分钟 </span>
        
      </div>
    </header>

    <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">文章目录</h2>
  <div class="post-toc-content always-active">
    <nav id="TableOfContents"></nav>
  </div>
</div>
    <div class="post-content">
      <p>以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。**特别提醒：删除分区后一定要先建立分区再保存，删除后点了保存会导致数据丢失，如果对<strong><strong>linux</strong></strong>不熟悉的，建议提交维护工单我司手工处理，费用30**<strong>元。<strong>该操作有风险，为避免误操作导致数据丢失，操作前请对您的重要数据进行备份！</strong></strong><br>
 <br>
<strong>提示：</strong><br>
 <br>
灰色内容为linux系统显示<br>
红色内容为输入的命令<br>
//绿色内容为命令或显示内容说明<br>
 <br>
 <br>
 <br>
[root@west5066 ~]# df -vh    //查看home分区所在的硬盘名称，我司一般是sdb<br>
文件系统              容量  已用可用已用% 挂载点<br>
/dev/sda1             9.7G  2.6G  6.7G  28% /<br>
tmpfs                 252M     0  252M   0% /dev/shm<br>
/dev/sdb1             9.9G  172M  9.2G   2% /home<br>
[root@west5066 ~]#service httpd stop //使用nginx的结束nginxd<br>
[root@west5066 ~]#service wdapache stop<br>
[root@west5066 ~]#service mysqld stop<br>
[root@west5066 ~]#fuser -m /home -k   //以上命令是停止服务<br>
[root@west5066 ~]#umount /home      //取消/home挂载<br>
[root@west5066 ~]#parted /dev/sdb    //输入parted /dev/sdb 这里是磁盘名,如果没有这个程序执行yum install parted 安装！<br>
GNU Parted 2.1<br>
使用 /dev/sdb<br>
Welcome to GNU Parted! Type &lsquo;help&rsquo; to view a list of commands.<br>
(parted) print<br>
Model: Virtio Block Device (virtblk)<br>
Disk /dev/sdb: 20GB                                       //记录磁盘总大小<br>
Sector size (logical/physical): 512B/512B<br>
Partition Table: msdos<br>
Number  Start   End    Size   Type     File system  标志<br>
1      1049kB  9.9G  9.9G  primary  ext4          //记录Start 大小<br>
(parted) rm 1<br>
 <br>
(parted) mkpart<br>
分区类型?  primary/主分区/extended/扩展分区? p<br>
文件系统类型?  [ext2]?       //直接回车<br>
<span style="color: #808080; font-family: Calibri;">起始点? </span>1049kB             //刚才记录的Start大小<br>
<span style="color: #808080; font-family: Calibri;">结束点? </span><span style="color: #ff0000; font-family: Calibri;">20GB            </span><span style="color: #00b050; font-family: Calibri;">//刚才记录的磁盘总大小<br /> </span><span style="color: #808080;">(parted) </span><span style="color: #ff0000;">quit<br /> </span>信息: You may need to update /etc/fstab.<br>
[root@west5066 ~]# resize2fs -f /dev/sdb1   //输入resize2fs -f /dev/sdb1，这里是分区名，如果提示fsck，请执行后再操作resize2fs<br>
resize2fs 1.39 (29-May-2006)<br>
Filesystem at /dev/sdb1 is mounted on /home; on-line resizing required<br>
Performing an on-line resize of /dev/sdb1 to 5242852 (4k) blocks.<br>
The filesystem on /dev/sdb1 is now 5242852 blocks long.<br>
[root@west5066 ~]#mount -a //挂载分区<br>
[root@west5066 ~]# df -vh    //再用df –lh 查询下home分区大小，可以看到已经增加了。<br>
文件系统              容量  已用可用已用% 挂载点<br>
/dev/sda1             9.7G  2.6G  6.7G  28% /<br>
tmpfs                 252M     0  252M   0% /dev/shm<br>
/dev/sdb1              20G  177M   19G   1% /home<br>
[root@west5066 ~]#service mysqld start<br>
[root@west5066 ~]#service httpd start         //使用nginx的启动nginxd<br>
[root@west5066 ~]#service wdapache start            //启动服务</p>
<div>
</div>
<div>
  以下是linux服务器增加home分区的操作流程，VPS或云主机升级后需要增加home分区大小的，可以按此方法增加。<strong>特别提醒：删除分区后一定要先建立分区再保存，删除后点了保存会导致数据丢失，如果对</strong><strong>linux</strong><strong>不熟悉的，建议提交维护工单我司手工处理，费用30</strong><strong>元。<strong>该操作有风险，为避免误操作导致数据丢失，操作前请对您的重要数据进行备份！</strong></strong><br /> &nbsp;<br /> <strong>提示：</strong><br /> &nbsp;<br /> 灰色内容为linux系统显示<br /> 红色内容为输入的命令<br /> //绿色内容为命令或显示内容说明<br /> &nbsp;<br /> &nbsp;<br /> &nbsp;<br /> [root@west5066 ~]# df -vh    //查看home分区所在的硬盘名称，我司一般是sdb<br /> 文件系统              容量  已用可用已用% 挂载点<br /> /dev/sda1             9.7G  2.6G  6.7G  28% /<br /> tmpfs                 252M     0  252M   0% /dev/shm<br /> /dev/sdb1             9.9G  172M  9.2G   2% /home<br /> [root@west5066 ~]#service httpd stop //使用nginx的结束nginxd<br /> [root@west5066 ~]#service wdapache stop<br /> [root@west5066 ~]#service mysqld stop<br /> [root@west5066 ~]#fuser -m /home -k   //以上命令是停止服务<br /> [root@west5066 ~]#umount /home      //取消/home挂载<br /> [root@west5066 ~]#parted /dev/sdb    //输入parted /dev/sdb 这里是磁盘名,如果没有这个程序执行yum install parted 安装！<br /> GNU Parted 2.1<br /> 使用 /dev/sdb<br /> Welcome to GNU Parted! Type 'help' to view a list of commands.<br /> (parted) print<br /> Model: Virtio Block Device (virtblk)<br /> Disk /dev/sdb: 20GB                                       //记录磁盘总大小<br /> Sector size (logical/physical): 512B/512B<br /> Partition Table: msdos<br /> Number  Start   End    Size   Type     File system  标志<br /> 1      1049kB  9.9G  9.9G  primary  ext4          //记录Start 大小<br /> (parted) rm 1<br /> &nbsp;<br /> (parted) mkpart<br /> 分区类型?  primary/主分区/extended/扩展分区? p<br /> 文件系统类型?  [ext2]?       //直接回车<br /> <span style="color: #808080; font-family: Calibri;">起始点? </span>1049kB             //刚才记录的Start大小<br /> <span style="color: #808080; font-family: Calibri;">结束点? </span><span style="color: #ff0000; font-family: Calibri;">20GB            </span><span style="color: #00b050; font-family: Calibri;">//刚才记录的磁盘总大小<br /> </span><span style="color: #808080;">(parted) </span><span style="color: #ff0000;">quit<br /> </span>信息: You may need to update /etc/fstab.<br /> [root@west5066 ~]# resize2fs -f /dev/sdb1   //输入resize2fs -f /dev/sdb1，这里是分区名，如果提示fsck，请执行后再操作resize2fs<br /> resize2fs 1.39 (29-May-2006)<br /> Filesystem at /dev/sdb1 is mounted on /home; on-line resizing required<br /> Performing an on-line resize of /dev/sdb1 to 5242852 (4k) blocks.<br /> The filesystem on /dev/sdb1 is now 5242852 blocks long.<br /> [root@west5066 ~]#mount -a //挂载分区<br /> [root@west5066 ~]# df -vh    //再用df –lh 查询下home分区大小，可以看到已经增加了。<br /> 文件系统              容量  已用可用已用% 挂载点<br /> /dev/sda1             9.7G  2.6G  6.7G  28% /<br /> tmpfs                 252M     0  252M   0% /dev/shm<br /> /dev/sdb1              20G  177M   19G   1% /home<br /> [root@west5066 ~]#service mysqld start<br /> [root@west5066 ~]#service httpd start         //使用nginx的启动nginxd<br /> [root@west5066 ~]#service wdapache start            //启动服务</p> 
  <div>
  </div>
  <div>
  </div>
</div>
    </div>

    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">文章作者</span>
    <span class="item-content">Feng</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">上次更新</span>
    <span class="item-content">
        2014-02-23
        
    </span>
  </p>
  
  
</div>
<div class="post-reward">
  <input type="checkbox" name="reward" id="reward" hidden />
  <label class="reward-button" for="reward">赞赏支持</label>
  <div class="qr-code">
    
    <label class="qr-code-image" for="reward">
        <img class="image" src="https://cdn.uu126.cn/hugo/wechat.png">
        <span>微信打赏</span>
      </label>
    <label class="qr-code-image" for="reward">
        <img class="image" src="https://cdn.uu126.cn/hugo/alipay.png">
        <span>支付宝打赏</span>
      </label>
  </div>
</div><footer class="post-footer">
      
      <nav class="post-nav">
        <a class="prev" href="/2014/68.html">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">VPS系统选择32位还是64位？</span>
            <span class="prev-text nav-mobile">上一篇</span>
          </a>
        <a class="next" href="/2014/66.html">
            <span class="next-text nav-default">linux nginx 网站访问提示502 Bad Gateway</span>
            <span class="next-text nav-mobile">下一篇</span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        

  
  <div id="vcomments"></div>
  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
  <script type="text/javascript">
    new Valine({
        el: '#vcomments' ,
        appId: '5sMkTX4FLjetFnfbOhaDTCDJ-9Nh9j0Va',
        appKey: '25KXCqIqAN142RQn4fBrsI87',
        notify:  false ,
        verify:  false ,
        avatar:'mm',
        placeholder: '说点什么吧...',
        visitor:  false 
    });
  </script>

  

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
  <a href="https://uu126.gitee.io/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="copyright-year">  
  Hosted by <a href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a> + <a href="https://cloud.tencent.com/redirect.php?redirect=1005&cps_key=4e78216aea817227ff0c96d93a00fd4b" target="_blank" rel="nofollow">腾讯云 + </a><a href="https://console.upyun.com/register/?invite=S1JeTquHL" target="_blank" rel="nofollow"><span class="with-love"><img src="https://cdn.lancn.cn/images/upyun.png" style="width:45px;vertical-align:middle;" alt="又拍云存储"></span></a>
   </span> 
  <div class="busuanzi-footer">
    <a target="_blank"  href="http://www.beian.miit.gov.cn">浙ICP备11026647号-3</a><span class="post-meta-divider"> | </span><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33088102001325"><span class="with-love"><img src="https://cdn.uu126.cn/icon-police.png" style="width:14px;"></span> 浙公网安备33088102001325号</a>
  </div>
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>
   

  

  <span class="copyright-year">
    &copy; 
    2012 - 
    2020<span class="heart"><i class="iconfont icon-heart"></i></span><span>Feng</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  <script src="/lib/highlight/highlight.pack.js?v=20171001"></script>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/js/main.min.c12618f9a600c40bd024996677e951e64d3487006775aeb22e200c990006c5c7.js"></script>








</body>
</html>
